package com.yueqian.dao;

import com.yueqian.domain.Traveller;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ITravellersDao {

    //根据orders表的id查询多个旅客
    @Select("select * from traveller where id in(select travellerid from order_traveller where orderid=#{oid})")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "name", property = "name"),
            @Result(column = "sex", property = "sex"),
            @Result(column = "phoneNum", property = "phoneNum"),
            @Result(column = "credentialsType", property = "credentialsType"),
            @Result(column = "credentialsNum", property = "credentialsNum"),
            @Result(column = "travellerType", property = "travellerType")
    })
    public List<Traveller> findTravellersById(String oid);
}
